﻿using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;

namespace Sino.CapacityCloud.Tests.Mocks
{

    public class MockLogger
       : ILogger, IDisposable
    {

        public void Log(LogLevel logLevel, int eventId, object state, Exception exception, Func<object, Exception, string> formatter)
        {
            Debug.WriteLine($"{logLevel}: {eventId} {formatter(state, exception)}");
        }

        public bool IsEnabled(LogLevel logLevel)
        {
            return true;
        }

        public IDisposable BeginScopeImpl(object state)
        {
            return this;
        }

        public void Dispose()
        {
        }

    }

    public class MockLogger<T>
        : MockLogger, ILogger<T>
    {
    }

}